import { defineStore } from "pinia";
import { getAuthorization, setAuthorization } from "@/utils/auth.js"

export const AuthStateStore = defineStore("AuthState", {
  state: () => {
    return {
      authState:[],
      userInfo:{}
    };
  },
  actions: {
    updateState(item) {
      this.authState = item
      setAuthorization('authState',this.authState)
    },
    updateUserInfo(item){
      this.userInfo = item
      setAuthorization('userInfo',this.userInfo)
    }
  },
});